import request from '@/utils/request'

// 查询品管首件确认作业
export function listFirstPartConfirmation(query) {
  return request({
    url: '/quality/firstPart/listConfirmation',
    method: 'get',
    params: query
  })
}
// 查询品管首件确认作业-高端
export function listFirstPartConfirmationG(query) {
  return request({
    url: '/quality/firstPart/listConfirmationG',
    method: 'get',
    params: query
  })
}
// 查询品管首件复核作业
export function listFirstPartRecheck(query) {
  return request({
    url: '/quality/firstPart/listRecheck',
    method: 'get',
    params: query
  })
}

// 品管首件判定获取基本视图
export function listFirstPartConfirmationDeatil(sjlId) {
  return request({
    url: '/quality/firstPart/getConfirmBaseView/' + sjlId,
    method: 'get'
  })
}

// 品管首件判定获取基本视图-高端
export function listFirstPartConfirmationDeatilG(sjlId) {
  return request({
    url: '/quality/firstPart/getConfirmBaseViewG/' + sjlId,
    method: 'get'
  })
}
// 品管首件判定获取基本视图-高端
export function getConfirmBaseViewByJtbh(jtbh) {
  return request({
    url: '/quality/firstPart/getConfirmBaseViewByJtbh/' + jtbh,
    method: 'get'
  })
}
// 品管首件保存
export function saveFirstPartConfirmation(data) {
  return request({
    url: '/quality/firstPart/doSaveFirstPart',
    method: 'put',
    data: data
  })
}
// 品管首件保存
export function saveFirstPartConfirmationG(data) {
  return request({
    url: '/quality/firstPart/doSaveFirstPartG',
    method: 'put',
    data: data
  })
}

// 更新品管复核按钮
export function updateFirstPartRecheck(data) {
  return request({
    url: '/quality/firstPart/updateFirstPartRecheck',
    method: 'put',
    data: data
  })
}

// 查询品管首件明细数据
export function listFirstPartDetailedData(query) {
  return request({
    url: '/quality/firstPart/listFirstPartStaticsView',
    method: 'get',
    params: query
  })
}

export function getFirstByGroupDay(query) {
  return request({
    url: '/quality/firstPart/getFirstByGroupDay',
    method: 'get',
    params: query
  })
}

export function getFirstByGroupWeek(query) {
  return request({
    url: '/quality/firstPart/getFirstByGroupWeek',
    method: 'get',
    params: query
  })
}

export function getFirstByGroupMonth(query) {
  return request({
    url: '/quality/firstPart/getFirstByGroupMonth',
    method: 'get',
    params: query
  })
}

// 查询品管首件明细数据
export function exportFirstPartStaticsDetail(query) {
  return request({
    url: '/quality/firstPart/export',
    method: 'get',
    params: query
  })
}

export function exportFirstByGroupDay(query) {
  return request({
    url: '/quality/firstPart/exportFirstByGroupDay',
    method: 'get',
    params: query
  })
}

export function exportFirstByGroupWeek(query) {
  return request({
    url: '/quality/firstPart/exportFirstByGroupWeek',
    method: 'get',
    params: query
  })
}

export function exportFirstByGroupMonth(query) {
  return request({
    url: '/quality/firstPart/exportFirstByGroupMonth',
    method: 'get',
    params: query
  })
}

// 检验标准文档路径
export function getJybzPath(wldm) {
  return request({
    url: `/pad/pad/getJybzPath/${wldm}`,
    method: 'get',
  })
}

// 手动刷首件
export function brushFirstPart(cardId, machine) {
  return request({
    url: '/pad/pad/instrOpera/53/' + cardId + '/' + machine,
    method: 'get',
  })
}
